import json
from jsonpath import jsonpath

json_str = '{"project":"spider","files":["audio.mp4","audio2.mp4","b.html","bili2.html","douban_now_playing.txt","m3u8DL-RE.exe","test.py","video.wmv","video2.wmv","灵笼.mp4","爬取灵笼.py","爬取豆瓣.py"],"tools":["scrapy"],"created":"2025-08-16"}'

json_dict = json.loads(json_str)

json_str1 = json.dumps(json_dict)

print(type(json_str1))

#
# with open('test.json', 'w', encoding='utf-8') as f:
#     json.dump(json_str1, f, ensure_ascii=False, indent=4)
    # f.write(json_str1)
    # f.close()


with open('test.json', 'r', encoding='utf-8') as f:
    data = f.read()
    print(data)
